﻿using System;
using GSE.Rpc;
using GSE.Network;
namespace GSE
{
    public class UnSupportedTransportTypeException : Exception
    {
        public UnSupportedTransportTypeException(TransportType t) : base($"un supported transport type {t}")
        {
        }
    }

    public class InvalidProtocolDataException : Exception
    {
        public InvalidProtocolDataException(string message) : base(message)
        {
        }

    }

    public class RpcCallTimeoutException : Exception
    {
        public RpcCallTimeoutException(int timeout) : base($"rpc call timedout after {timeout} milliseconds.")
        {
        }

    }

    public class RpcSeviceNotExistsException : Exception
    {
        public RpcSeviceNotExistsException(string serviceName) : base(serviceName)
        {
        }
    }

    public class RpcServiceParamException : Exception
    {

    }

    public class RpcServiceProcessException : Exception
    {

    }

    public class RpcServiceUnknownException : Exception
    {
        public RpcServiceUnknownException(ResponseStatus statusCode) : base($"Got unknown server response code {statusCode}")
        {

        }
    }

    public class RpcServiceConnectionException : Exception
    {
        public RpcServiceConnectionException(string remoteAddress) : base($"Connnection to server has errors: {remoteAddress}")
        {
        }
    }

    public class UnRegisteredEventException : Exception
    {
        public UnRegisteredEventException(string name) : base($"Event \"{ name}\" has not been registered!")
        {

        }
    }

    public class EventSubscriptionSeriesIDOverflowException : Exception
    {
        public EventSubscriptionSeriesIDOverflowException(string msg) : base(msg)
        {

        }
    }
}